﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections;

namespace SARUserControls
{
	/// <summary>
	/// 数据表格
	/// </summary>
	public partial class SARDataTable : UserControl
	{
		public SARDataTable()
		{
			this.InitializeComponent();
		}

        /// <summary>
        /// 绑定的数据源，实例程序如下
        /// public class TestBean
        ///{
        ///    public string Header1;
        ///    public string Header2;
        ///    public string Header3;
        ///    public string Header4;
        ///}
        ///
        ///    List<TestBean> testData = new List<TestBean>();
        ///    testData.Add(new TestBean("asdf", "asdf", "gfdg", "wet"));
        ///    testData.Add(new TestBean("阿萨德", "算法", "随风倒", "该罚的"));
        ///    this.dataTable.SARItemsSource = testData;
        ///    
        /// </summary>
        public IEnumerable SARItemsSource
        {
            set
            {
                this.dataGrid.ItemsSource = value;
            }
            get
            {
                return this.dataGrid.ItemsSource;
            }
        }

        /// <summary>
        /// 内部DataGrid，一般情况下，不需要使用
        /// </summary>
        public DataGrid SARnterDataGrid
        {
            get
            {
                return this.dataGrid;                   
            }
        }
	}
}